/*
 * @Author: yangzonglong
 * @Date: 2021-02-25 13:39:20
 * @version: v1.0.0
 * @Descripttion:
 * @LastEditors: 871387321@qq.com 871387321@qq.com
 * @LastEditTime: 2023-11-14 17:11:07
 * @Auditor:
 */
import React from 'react';
import classname from 'classnames';
import style from './icon.module.scss';
const iconMap = {
  move: '\ue671',
  remove: '\ue666',
  view: '\ue607',
  row: '\ue683',
  col: '\ue684',
  input: '\ue665',
  number: '\ue664',
  json: '\ue66c',
  pc: '\ue795',
  date: '\ue668',
  select: '\ue669',
  radio: '\ue660',
  text: '\ue661',
  copy: '\ue667',
  textArea: '\ue65b',
  checkbox: '\ue65d',
  switch: '\ue662',
  table: '\ue65f',
  upload: '\ue641',
  line: '\ue674',
  blank: '\ue675',
  img: '\ue676',
  edit: '\ue656',
  link: '\ue677',
  linkComBox: '\ue678',
  media: '\ue679',
  richtext: '\ue65e',
  script: '\ue67a',
  odNum: '\ue67d',
  button: '\ue67f',
  dataList: '\ue67e',
  code: '\ue680',
  modelToForm: '\ue682',
  artTemplate: '\ue681',
  collapse: '\ue68f',
  tag: '\ue690'
};
interface IProps {
  icon: string;
  onClick?(): void;
  className?: any;
  ref?: any;
  style?: any;
}

const Icon = ({ icon, onClick, className, ref, style: styles }: IProps) => {
  return (
    <span
      ref={ref}
      onClick={onClick}
      className={classname(style.iconfont, {
        [style.pointer]: onClick,
        [className]: true,
      })}
      style={styles || {}}
    >
      {iconMap[icon] || icon}
    </span>
  );
};

export default Icon;
